package com.currency.mall.adapter;

import android.content.Context;
import android.support.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.currency.mall.R;
import com.currency.mall.entity.PledgeListBean;

import java.math.BigDecimal;
import java.util.List;

/**
 * Created by Administrator on 2018/12/5.
 */

public class PledgeListAdapter extends BaseQuickAdapter<PledgeListBean, BaseViewHolder> {

    public PledgeListAdapter(@Nullable List<PledgeListBean> data, Context context) {
        super(R.layout.item_pledge, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, PledgeListBean pledgeListBean) {
        helper.addOnClickListener(R.id.bt_pledge);
        helper.setText(R.id.tv_name,pledgeListBean.getiTo());
        helper.setText(R.id.tv_cpu,pledgeListBean.getCpu()+" EOS");
        BigDecimal bd = new BigDecimal(pledgeListBean.getNet()+"");
        String minValue = bd.toPlainString();
        helper.setText(R.id.tv_net,minValue+" EOS");

    }

}
